package 多线程02_常见线程方法;

import 多线程01_启动线程.Hero;

/**
 * @ClassName: TestThreadJoin
 * @Author: AllenSun
 * @Date: 2022/3/18 下午8:37
 */
public class TestThreadDaemon {
    public static void main(String[] args) {
        Hero gareen = new Hero("盖伦",616,100);
        Hero teemo = new Hero("提莫",300,130);
        Hero bh = new Hero("赏金猎人",350,165);
        Hero leesin = new Hero("盲僧",455,180);

        Thread t1= new Thread(){
            public void run(){
                int seconds =0;

                while(seconds<11){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    System.out.printf("已经玩了LOL %d 秒%n", seconds++);
                }
            }
        };
        t1.setDaemon(true);
        t1.start();
    }
}
